# note/adminx.py

import xadmin

from .models import NoteProfile, note_comment_profile


class NoteProfileAdmin(object):
    '''笔记列表'''

    list_display = ['userprofile_id', 'note_title', 'note_label', 'last_saved', 'is_published']
    search_fields = ['note_title', 'note_content', 'note_label', 'is_published']
    list_filter = ['userprofile_id', 'note_title', 'note_content', 'note_label', 'last_saved',
                   'note_collected_num', 'note_reading_quantity', 'note_shared_num', 'note_agreed_num',
                   'note_opposed_num', 'note_commented_num', 'note_informed_num', 'is_published']


class note_comment_profileAdmin(object):
    # 显示的列
    list_display = ['userprofile_id', 'note_comment_userprofile_id', 'note_id', 'note_comment_content']


xadmin.site.register(NoteProfile, NoteProfileAdmin)
xadmin.site.register(note_comment_profile, note_comment_profileAdmin)
